
import flash.events.Event;
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.display.BitmapData;
import flash.display.Bitmap;
import flash.geom.Matrix;
import flash.text.TextField;
import flash.text.TextFormat;

class FadingText extends TextField {
  public function new()
  {
    super();
    selectable = false;
    mouseEnabled = false;
    flash.Lib.current.addChild(this);
  }
  public function start()
  {
   this.addEventListener(Event.ENTER_FRAME, fadeOut);
  }

function fadeOut(e:Event){
	alpha -= 0.02;
        if(alpha < 0)
          {flash.Lib.current.removeChild(this);}
  }
}